<extend name="_top"/>


<block name="body">
 <div class="aw-register-box">
	<h1>找回密码</h1>
	<h2>在这里找到最初的你自己</h2>
	<div class="mod-body">
        <form class="login-form" id="J_findpwd_form" action="{:U('Member/miMobile')}" method="post">
			<ul>
				<li>
					<input type="text" id="inputEmail" class="form-control" placeholder="{:L('_MI_MOBILE_PLACEHOLDER_')}"
                               ajaxurl="/member/checkUserEmailUnique.html" errormsg="{:L('_MI_EMAIL_ERROR_')}" nullmsg="{:L('_MI_EMAIL_')}"
                               datatype="e" value="" name="mobile">
				</li>
				<li>
					<div class="form-group  tab-pane">
					<input type="hidden" name="reg_type" value="mobile">
                    <input type="text" id="inputPassword" class="form-control pull-left" placeholder="{:L('_MI_CODE_')}"
                                   errormsg="{:L('_MI_CODE_ERROR_')}" nullmsg="{:L('_MI_CODE_NULL_')}" datatype="*5-5" name="verify" style="width: 130px">
					<a class="btn btn-primary" data-role="getVerify" style="margin-left: 10px">获取验证码</a>						
					</div>
				</li>
                <li class="last">
					<button class="btn btn-large btn-primary" type="submit" style="width: 320px;">找回密码</button>
				</li>
			</ul>
                
        </form>
    </div>
	<div class="mod-footer">
		<ul id="reg_nav">
			<li style="padding-left:20px;"><a href="{:U('Member/login')}">返回登陆</a></li>
			<li>|</li>
			<php>if(check_reg_type('email')){</php>
			<li><a href="{:U('Member/mi')}">邮箱密码找回</a></li>
			<php>}</php>
		</ul>
	</div>
</div>
</block>


<block name="side"></block>
<block name="script">
    <script type="text/javascript">

        $(document)
                .ajaxStart(function () {
                    $("button:submit").addClass("log-in").attr("disabled", true);
                })
                .ajaxStop(function () {
                    $("button:submit").removeClass("log-in").attr("disabled", false);
                });


        $(function () {
            $("form").submit(function () {
                var self = $(this);
                $.post(self.attr("action"), self.serialize(), success, "json");
                return false;

                function success(data) {
                    handleAjax(data);
                }
            });
            $("[data-role='getVerify']").click(function () {
                var account = $('[name="mobile"]').val();

                var type = $(this).parents('.tab-pane').find('[name="reg_type"]').val();

                $.post("{:U('Ucenter/verify/sendVerifyFindPsw')}", {
                    account: account,
                    type: type,
                    action: 'member'
                }, function (res) {
                    if (res.status) {
                        toast.success(res.info);
                    }
                    else {
                        toast.error(res.info);
                    }
                })
            })


        });
    </script>
</block>
